]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
network: Make sortByName to properly handle null values
authorMarco Trevisan (Treviño) <mail@3v1n0.net>
Wed, 9 Jul 2025 03:56:27 +0000 (05:56 +0200)
committerMarge Bot <marge-bot@gnome.org>
Sat, 12 Jul 2025 19:11:52 +0000 (19:11 +0000)
g_utf8_collate is not nullable, but is used in a relevant piece of code,
so better not to throw any error if a null value is compared

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3785>

js/ui/status/network.js

index 4cabfda655e8fe1c44df29171433a4644801fd05..96ca1ad025d797d90d33bb21ca6d620669981bdc 100644 (file)
@@ -116,7 +116,7 @@ class ItemSorter {
     }
 
     _sortByName(one, two) {
-        return GLib.utf8_collate(one.name, two.name);
+        return GLib.utf8_collate(one.name ?? '', two.name ?? '');
     }
 
     _sortByMru(one, two) {